package com.chexiehui.jc.mvp.mine;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BaseView;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 修改手机号
 * @Auth SongJun
 * @Date 2019/11/28 18:48
 **/
public interface ChangePhoneBindCovenant {

    interface View extends BaseView {
        void onSendCodeSuccess(BaseModel<Object> successResult);

        void onSendCodeFailure(BaseModel<Object> failureResult);

        void onSaveSuccess(BaseModel<Object> successResult);

        void onSaveFailure(BaseModel<Object> failureResult);

        String getOldPhone();
        String getInputPhone();

        String getInputCode();
    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.SEND_CODE)
        Observable<BaseModel<Object>> getCode(
                @Field("phone") String phone);

        @FormUrlEncoded
        @POST(Constants.URL_CHANGE_PHONE)
        Observable<BaseModel<Object>> save(
                @Field("phone") String phone,
                @Field("code") String code);
    }

    interface Presenter {
        void sendCode();
        void save();
    }

}